var gulp = require("gulp");
// var babel = require("gulp-babel");
// var jshint = require('gulp-jshint');       //js检查
var uglify = require('gulp-uglify');       //js压缩
var rename = require('gulp-rename');       //重命名
var concat = require('gulp-concat');       //合并文件


//压缩并合并js
gulp.task('jsmin', async() => {
    var jsSrc = [
        'src/remLayout.js',
    ];
    gulp.src(jsSrc)
        .pipe(concat('remLayout.js'))//合并
        //.pipe(concat('**.js'))//合并
        //.pipe(babel()) // ES6 转 ES5
        .pipe(rename({ suffix: '.min' }))//重命名
        .pipe(uglify())//js压缩
        .pipe(gulp.dest('dist/'));
});


// gulp.task('default',['jsmin']);